package com.nbrc.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;

/**
 * Myleave entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "myleave", catalog = "nbrcactiviti")
public class Myleave implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -7482883726696716894L;
	private String id;
	private User user;
	private String content;
	private String title;

	// Constructors

	/** default constructor */
	public Myleave() {
	}

	/** minimal constructor */
	public Myleave(String id) {
		this.id = id;
	}

	/** full constructor */
	public Myleave(String id, User user, String content, String title) {
		this.id = id;
		this.user = user;
		this.content = content;
		this.title = title;
	}

	// Property accessors
	@Id
	@Column(name="id",nullable = false,length=40)
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid",strategy="org.hibernate.id.UUIDGenerator")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userid")
	@JsonIgnore
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "content")
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "title")
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

}